﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PresentacionWindows.Base;
using Negocio.Generico;
using Integra.PresentacionWindows.Base.Excepcion;


namespace Integra.PresentacionWindows.Base
{
    public class FormComun : System.Windows.Forms.Form
    {

        #region Constructor

        public FormComun()
		{
			this.ControlBox = false;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.MaximizeBox=false;
			this.MinimizeBox=true;

			this.BackColor = ConfigUI.ColorFondoForm;
			this.ForeColor = ConfigUI.ColorLetraForm;
			this.Font = (Font)ConfigUI.Fuente.Clone();
			//this.Icon = ConfigUI.IconoForm;
        }

        #endregion

        #region Funciones virtuales

        /// <summary>
        /// Muestra un dialogo de excepcion.
        /// Permite sobrescribirlo para utilizar un dialogo
        /// de excepcion distinto del estandar
        /// </summary>
        /// <param name="ex">Excepcion que se va a mostrar</param>
        public virtual DialogResult MostrarExcepcion(Exception ex)
        {
            DialogResult dr = DialogResult.None;
            //Excepcion.Excepcion ex1 = new Integra.PresentacionWindows.Base.Excepcion.Excepcion(ex);
            //ex1.from
            //Excepcion myex = Excepcion.FromException(ex);
            //FormExcepcion f = new FormExcepcion(myex);
            //f.ShowDialog(this);
            //dr = f.DialogResult;
            return dr;
        }

        #endregion
    }
}